<?php

namespace app\common\model\sales;

use think\Model;


class CheckoutGoods extends Model
{


    

    // 表名
    protected $name = 'sales_checkout_goods';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];


    public function goods_status(){
        return array(
            1=>'待出库',
            2=>'',
        );
    }
    public function salescheckout()
    {
        return $this->belongsTo('app\common\model\sales\Checkout', 'sales_checkout_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
    public function goods()
    {
        return $this->belongsTo('app\common\model\goods\Goods', 'goods_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function salesslip()
    {
        return $this->belongsTo('app\common\model\sales\Slip', 'sales_slip_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }

    public function storehouse()
    {
        return $this->belongsTo('app\common\model\Storehouse', 'storehouse_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
    public function customer()
    {
        return $this->belongsTo('app\common\model\customer\Customer', 'customer_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
